package Operate;

import Contact.Contacts;
import Contact.Contactsllist;

import java.util.Scanner;

public class Dul implements Operation {
    @Override
    public void Operate(Contactsllist contactsllist) {
        int s=contactsllist.getS();
        System.out.println("输入你想要查找的姓名；");
        Scanner scanner=new Scanner(System.in);
        String name=scanner.nextLine();
        for (int i = 0; i < s; i++) {
            String name1=contactsllist.Show(i).name;
            if (name.equals(name1)) {
                System.out.println("找到了！");
                System.out.println(contactsllist.Show(i));
                contactsllist.Dul(i);
                break;
            } else {
                System.out.println("没找到！");
            }
        }
    }
}
